//
//  Shape.m
//  桥接模式
//
//  Created by flannery on 2018/12/19.
//  Copyright © 2018年 flannery. All rights reserved.
//

#import "Shape.h"
#import "DrawAPI.h"

@implementation Shape
- (instancetype)initWithDrawAPI:(DrawAPI *)drawAPI{
    if(self = [super init]) {
        self.drawAPI = drawAPI;
    }
    return self;
}
- (void)draw{}
@end

@interface Circle ()
@property (nonatomic, assign) int x;
@property (nonatomic, assign) int y;
@property (nonatomic, assign) int radius;
@end
@implementation Circle
- (instancetype)initWithX:(int)x Y:(int)y radius:(int)radius drawAPI:(DrawAPI *)drawAPI{
    if(self = [super initWithDrawAPI:drawAPI]) {
        self.x = x;
        self.y = y;
        self.radius = radius;
    }
    return self;
}

- (void)draw{
    [super.drawAPI drawCircleWithX:self.x Y:self.y radius:self.radius];
}
@end
